package com.chang.controller;

import cn.hutool.core.bean.BeanUtil;
import com.chang.common.bean.PageBean;
import com.chang.common.bean.ResultBean;
import com.chang.common.controller.BaseController;
import com.chang.query.ProductQuery;
import com.chang.service.ProductService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @program: erp-api
 * @description:
 * @author: chang
 * @create: 2025-02-27 11h
 **/
@RestController
@RequestMapping("/api")
@Api(tags = "产品管理ss")

public class ProductController extends BaseController {

    @Autowired
    ProductService productService;

    @ApiOperation("产品列表")
    @PostMapping("/product")
    public ResultBean query(@RequestBody ProductQuery query){
        PageBean pageBean=productService.queryByMap(BeanUtil.beanToMap(query));
        return success("产品列表",pageBean);
    }
}
